#include <QCoreApplication>
#include <thread>
#include <downloadserver.h>
#include <QDebug>
#include <QThread>

int callback(int t) {
    qDebug() << "callback " << t;
}

void ctrlTask()
{
    int i = 5;
    while (i>0) {
        QThread::msleep(2000);
        qDebug() << "ctrlTask tid=" << QThread::currentThread();
        DownloadServer::getInstance()->startDownload("/e/config.xml");
        i--;
    }

}

int main(int argc, char *argv[])
{

    DownloadServer::getInstance()->init();
    qDebug() << "main thread start";
    std::thread *t2 = new std::thread(ctrlTask);
    t2->join();
    qDebug() << "main thread exit";

}
